package com.hospital.hospitalworkcenterservice.web;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.hospital.common.dto.SickpersonDto;
import com.hospital.common.vo.ResultEntity;

import com.hospital.hospitalworkcenterservice.entity.Medicalrecordstatus;
import com.hospital.hospitalworkcenterservice.entity.Sickperson;
import com.hospital.hospitalworkcenterservice.service.IMedicalrecordstatusService;
import com.hospital.hospitalworkcenterservice.service.ISickpersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 患者表 前端控制器
 * </p>
 *
 * @author 王春备
 * @since 2020-10-20
 */
@RestController
@RequestMapping("/sickperson")
public class SickpersonController {

    @Autowired
    ISickpersonService iSickpersonService;

    @Autowired
    IMedicalrecordstatusService iMedicalrecordstatusService;

    @RequestMapping("/list")
    public ResultEntity listall(Page page, SickpersonDto sickPersonDto){

        IPage<Sickperson> page1 = iSickpersonService.findPage(page, sickPersonDto);

        return ResultEntity.ok("操作成功",page1);
    }
    //就诊状态查询
    @RequestMapping("/jiulist")
    public List<Medicalrecordstatus> jiulist(){

        List<Medicalrecordstatus> list = iMedicalrecordstatusService.list();

        return list;
    }

    //根据ID查询
    @RequestMapping("/selectByid")
    public Sickperson selectByid(Integer id){

        Sickperson selectByid = iSickpersonService.selectByid(id);

        return selectByid;
    }

}
